package com.design.pattern.observer.context;

import java.util.Observable;
import java.util.Observer;

public class User implements Observer {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable o, Object arg) {
        Oauth oauth=(Oauth)arg;
        System.out.println(this.getName()+"订阅的作者："+oauth.getName()+",发布了新文章：《"+oauth.getMessage()+"》.");
    }
}
